home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / serien / purity / nr.40 / memsize / memsize.p < prev    next >
Text File  |  1994-12-13  |  1KB  |  37 lines

  1. program MemSize;
  2. var s,i,j,k:integer;
  3.     pa,pb,pc,l:string;
  4.     a:real;
  5.     n:short;
  6.     f:boolean;
  7.  
  8. {$I "Include:Exec/Memory.i"}
  9. {$I "Include:Utils/Parameters.i"}
  10. {$I "Include:Utils/StringLib.i"}
  11. {$I "Include:Libraries/Dos.i"}
  12.  
  13. begin
  14.  pa:="   ";pb:="        ";a:=0;
  15.  pc:="                                                                      ";
  16.  getparam(1,pa);
  17.  if not strieq(pa,"MIN") and not strieq(pa,"MAX") then begin
  18.   writeln("\e[1;4;33mM e m S i z e   V1.1   \e[22;33;3mby Stefan Grad of GPD \e[23m -  FREEWARE  -  © 20-11-94\e[0m");
  19.   writeln("\e[3mUSAGE: \e[0mMemSize <MIN|MAX> <Size> <ProgramName>");
  20.   writeln("Size = Min/max amount of memory (bytes) necessary to/not to run <ProgramName>");
  21.  end;
  22.  if strieq(pa,"MIN") or strieq(pa,"MAX") then begin
  23.   getparam(2,pb);
  24.   for i:=0 to 7 do begin
  25.    for j:=0 to 9 do begin
  26.     k:=inttostr(l,j);
  27.     if pb[i]=l[0] then a:=a*10+j;
  28.    end;
  29.   end;
  30.   getparam(3,pc);
  31.   s:=availmem(1);
  32.   if strieq(pa,"MIN") and (s>a) then f:=execute(pc,nil,nil);
  33.   if strieq(pa,"MAX") and (s<a) then f:=execute(pc,nil,nil);
  34.  end;
  35. end.
  36.  
  37.